abstract class UnitConversion {
  def convert(value: Double): Double
}

class Point(val x: Int, val y: Int)

object Sheet6 extends App {
  println(args.reverse.mkString(" "))

  println(CardSuit.values.map(x => x.toString -> CardSuit.isRed(x)))

}

object Conventions {
  def inchesToCentimeters(inches: Double): Double = {
    inches * 2.54
  }

  def gallonsToLiters(gallons: Double): Double = {
    gallons * 3.7854118
  }

  def milesToKilometers(miles: Double): Double = {
    miles * 1.609344
  }
}

object InchesToCentimeters extends UnitConversion {
  override def convert(value: Double): Double = {
    Conventions.inchesToCentimeters(value)
  }
}

object GallonsToLiters extends UnitConversion {
  override def convert(value: Double): Double = {
    Conventions.gallonsToLiters(value)
  }
}

object MilesToKilometers extends UnitConversion {
  override def convert(value: Double): Double = {
    Conventions.milesToKilometers(value)
  }
}

object Origin extends java.awt.Point(0, 0) // because its inner state will change

object Point {
  def apply(x: Int, y: Int): Point = new Point(x, y)
}

object CardSuit extends Enumeration {
  type CardSuit = Value
  val SPADE: CardSuit.Value = Value("♠")
  val CLUB: CardSuit.Value = Value("♣")
  val SQUARE: CardSuit.Value = Value("♦")
  val HEART: CardSuit.Value = Value("♥")

  def isRed(cardSuit: CardSuit): Boolean = cardSuit match {
    case SPADE => false
    case CLUB => false
    case SQUARE => true
    case HEART => true
  }
}

object RGBCorner extends Enumeration {
  type RGB = Value
  val BLACK: RGBCorner.Value = Value(0x000000, "BLACK")
  val RED: RGBCorner.Value = Value(0xFF0000, "RED")
  val GREEN: RGBCorner.Value = Value(0x00FF00, "GREEN")
  val BLUE: RGBCorner.Value = Value(0x0000FF, "BLUE")
  val YELLOW: RGBCorner.Value = Value(0xFFFF00, "YELLOW")
  val MAGENTA: RGBCorner.Value = Value(0xFF00FF, "MAGENTA")
  val CYAN: RGBCorner.Value = Value(0x00FFFF, "CYAN")
  val WHITE: RGBCorner.Value = Value(0xFFFFFF, "WHITE")
}
